package com.study.ws.config.ws.session_manager;

import java.util.Collection;

/**
 * 会话管理
 *
 * @author xl-9527
 * @since 2025/3/25
 **/
public interface ISessionManager<T> {

    void addSession(final T session, final Integer userId);

    void removeSession(final Integer userId);

    T getSession(Integer userId);

    Integer getUserId(T session);

    default Collection<T> getAllSession() {
        throw new NullPointerException("web socket session is empty");
    }
}
